import {
  LgetItem
} from '@/utils/storage'
const status = {
  state: {
    loading: false,
    current: LgetItem('current') || 0,
    url:'',
    h5Url:''
  },
  getters: {
    loading: state => state.loading,
    current: state => state.current,
    url: state => state.url
  },

  mutations: {
    SET_LOADING: (state, loading) => {
      state.loading = loading
    },
    SET_CURRENT: (state, current) => {
      state.current = current
    },
    SET_URL: (state, time) => {
      state.url = `${state.h5Url}&timestamp=${time}`
    },
    SET_H5URL: (state, url) => {
      state.url = `${url}&timestamp=${new Date().getTime()}`
      state.h5Url=url
    }
  },

  actions: {}


}



export default status